/*
 * logInfo: logs info in log file
 * 
 * This replaces "console.log" as this doesn't work in a jailed environment.
 * Logging using a child "logger" process is a workaround for it
 */
var child_process = IMPORTS.require('child_process');

function logInfo(s) {
    //var command = 'logger -p user.err "com.hpit.cdc.pagetrans.service: ' + s + '"';
    //var child = exec(command, function(error, stdout, stderr) {});
    log('INFO',s); 
}

function log(level, s) {
  var logger = child_process.spawn('logger', ['-t', level, '-p', 'user.err']);
  logger.stdin.write(s + '\n');
  logger.stdin.end();
}

var LoginCommandAssistant = function() {
}

LoginCommandAssistant.prototype.run = function(final_future) {   
    //get content from url
    //get_url_response(this.controller.args.name, final_future);
    
    //get content from a file
    //get_file_response(TEST_FILE_NAME, final_future);
    
    //login(username, passowrd);   
    final_future.result = { reply : "haohao"};
  
}

